package 华为机试;

import java.util.Scanner;

public class 第二题提交通过版本 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String str = sc.nextLine();
            char[] carr = str.toCharArray();
            boolean flag = isRight(carr);
            if (flag) {
                if (isRight(carr)) {
                    StringBuilder res1 = new StringBuilder();
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < carr.length; i++) {
                        char tmp = carr[i];
                        if (Character.isDigit(tmp)) {
                            sb.append(tmp);
                        } else {
                            if (sb.length() > 0) {
                                int icount = Integer.parseInt(sb.toString());
                                for (int j = 0; j < icount; j++)
                                    res1.append(tmp);
                                sb = new StringBuilder();
                            } else {
                                res1.append(tmp);
                            }
                        }
                    }
                    System.out.println(res1.toString());
                }
            }
        }
        sc.close();
    }

    private static boolean isRight(char[] carr) {
        StringBuilder sb = new StringBuilder();
        int count = 1;
        boolean flag = true;
        for (int i = 0; i < carr.length && flag; i++) {
            char tmp = carr[i];
            if (Character.isDigit(tmp)) {
                if (count >= 3) {
                    flag = false;
                    break;
                }
                count = 0;
                sb.append(tmp);

            } else if (Character.isLetter(tmp)) {
                if (sb.length() > 0) {
                    int icount = Integer.parseInt(sb.toString());
                    if (icount <= 2) {
                        flag = false;
                        break;
                    }
                    sb = new StringBuilder();
                }
                if (i > 0) {
                    if (tmp == carr[i - 1]) {
                        count++;
                        if (count >= 3) {
                            flag = false;
                            break;
                        }
                    } else
                        count = 1;
                }
            } else {
                flag = false;
                break;
            }
        }
        if (count >= 3)
            flag = false;
        if (Character.isDigit(carr[carr.length - 1]))
            flag = false;
        if (!flag)
            System.out.println("!error");
        return flag;
    }
}
